-
Notifications
You must be signed in to change notification settings - Fork 838
wpcomsh: use APD for user token #45303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Wpcomsh plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Code Coverage SummaryThis PR did not change code coverage! That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷 |
d06f3cd to
e5c77f3
Compare
a3c6def to
1f1a83f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR extends the Atomic Storage Provider to support user-level connection data from Atomic Persistent Data (APD), enabling full connection management for WordPress.com Atomic sites.
- Adds support for
master_useranduser_tokensretrieval from external storage - Implements token validation logic to handle conflicts and orphaned tokens
- Adds comprehensive test coverage for new functionality
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| projects/plugins/wpcomsh/connection/class-atomic-storage-provider.php | Implements user token and master user retrieval with validation logic |
| projects/plugins/wpcomsh/tests/AtomicStorageProviderTest.php | Adds comprehensive tests for new user token functionality |
| projects/plugins/wpcomsh/tests/lib/mocks/class-jetpack-options.php | Updates mock to handle grouped options for testing |
| projects/plugins/wpcomsh/changelog/update-external-storage-user-connection | Documents the feature addition |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
projects/plugins/wpcomsh/changelog/update-external-storage-user-connection
Outdated
Show resolved
Hide resolved
projects/plugins/wpcomsh/connection/class-atomic-storage-provider.php
Outdated
Show resolved
Hide resolved
projects/plugins/wpcomsh/connection/class-atomic-storage-provider.php
Outdated
Show resolved
Hide resolved
projects/plugins/wpcomsh/connection/class-atomic-storage-provider.php
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just noticed a few things we might need to double check.
projects/plugins/wpcomsh/connection/class-atomic-storage-provider.php
Outdated
Show resolved
Hide resolved
projects/plugins/wpcomsh/connection/class-atomic-storage-provider.php
Outdated
Show resolved
Hide resolved
projects/plugins/wpcomsh/connection/class-atomic-storage-provider.php
Outdated
Show resolved
Hide resolved
projects/plugins/wpcomsh/connection/class-atomic-storage-provider.php
Outdated
Show resolved
Hide resolved
f50f3d2 to
aa3e166
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for helping me test this one - I followed most steps except where it involved creating a new email in order to change email address on a WP account. Everything else tested as expected.
I'd leave a final review to @sergeymitr who has more knowledge here. Left a small test related question though :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well, great job 👍
This PR adds support for connection owner tokens stored in APD. Tokens are stored in two parts (secret and email). The email is used to assemble a "normal" Jetpack token by extracting the local user ID from an email address.
Closes CONNECT-35
Proposed changes:
Other information:
Jetpack product discussion
https://linear.app/a8c/project/external-storage-for-connection-data-cd44d4d97124/overview
Does this pull request change what data or activity we track or use?
Testing instructions: